/** When your routing table is too long, you can split it into small modules **/

import { BasicLayout, BlankLayout } from '@/layout'

const systemRouter = {
  path: '/system',
  component: BasicLayout,
  name: 'System',
  redirect: '/system/permission/user',
  meta: {
    title: '系统',
    icon: 'system'
  },
  children: [{
    path: 'permission',
    name: 'Permission',
    component: BlankLayout,
    redirect: '/system/permission/user',
    meta: { title: '权限', icon: 'role' },
    children: [
      {
        path: 'user',
        component: () => import('@/views/system/permission/user/list'),
        name: 'User',
        meta: { title: '用户', icon: 'user' }
      },
      {
        path: 'user-group',
        component: () => import('@/views/system/permission/user-group/list'),
        name: 'UserGroup',
        meta: { title: '用户组', icon: 'group' }
      },
      {
        path: 'role',
        component: () => import('@/views/system/permission/role/list'),
        name: 'Role',
        meta: { title: '角色', icon: 'role' }
      },
      {
        path: 'menu',
        component: () => import('@/views/system/permission/menu/tree'),
        name: 'Menu',
        meta: { title: '菜单', icon: 'menu' }
      },
      {
        hidden: true,
        path: 'ui-alloc',
        component: () => import('@/views/system/permission/menu/alloc'),
        name: 'UIAlloc',
        meta: { title: '分配UI权限', icon: 'menu' }
      },
      {
        hidden: true,
        path: 'component',
        component: () => import('@/views/system/permission/component/list'),
        name: 'Component',
        meta: { title: '组件', icon: 'component' }
      },
      {
        path: 'api',
        component: () => import('@/views/system/permission/api/list'),
        name: 'Api',
        meta: { title: 'API', icon: 'api' }
      },
      {
        path: 'api-category',
        component: () => import('@/views/system/permission/api-category/list'),
        name: 'ApiCategory',
        meta: { title: 'API分类', icon: 'api' }
      },
      {
        hidden: true,
        path: 'api-alloc',
        component: () => import('@/views/system/permission/api/alloc'),
        name: 'ApiAlloc',
        meta: { title: '分配API权限' }
      }]
  },
  {
    path: 'log',
    name: 'Log',
    component: BlankLayout,
    redirect: '/system/log/access-log',
    meta: { title: '日志', icon: 'log' },
    children: [
      {
        path: 'access-log',
        component: () => import('@/views/system/log/access-log'),
        name: 'AccessLog',
        meta: { title: '访问日志', icon: 'access' }
      }, {
        path: 'exception-log',
        component: () => import('@/views/system/log/exception-log'),
        name: 'ExceptionLog',
        meta: { title: '异常日志', icon: 'exception' }
      }]
  },
  {
    path: 'dict',
    name: 'Dict',
    component: BlankLayout,
    redirect: '/system/dict/type-list',
    meta: { title: '系统字典', icon: 'dict' },
    children: [
      {
        path: 'type',
        component: () => import('@/views/system/dict/type-list'),
        name: 'DictType',
        meta: { title: '系统字典', icon: 'dict' }
      },
      {
        hidden: true,
        path: 'data',
        component: () => import('@/views/system/dict/data-list'),
        name: 'DictData',
        meta: { title: '系统字典值域', icon: 'group' }
      }]
  }]

}

export default systemRouter
